import { Controller } from "../../mvc/core/Controller";
import { MessageBlock } from "../../../Framework/MQ/MessageBlock";
import { SPlayerWingCollection } from "../../../Message/Game/SPlayerWingCollection";
import { EMergeType } from "../../../Message/Public/EMergeType";
import { IFashionBoxModule } from "../../../modules/interfaces/IFashionBoxModule";
import { IView } from "../../mvc/interfaces/IView";
import { FashionBoxModule } from "../../../modules/FashionBoxModule";
import { FashionBoxFlyWingFeedPanel } from "../view/fashionBox/fashionFlyWing/FashionBoxFlyWingFeedPanel";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { EventName } from "../mvc/EventName";
import { NetDispatcher } from "../../mvc/core/NetDispatcher";
import { ServerCommand } from "../mvc/ServerCommand";
import { EGateCommand } from "../../../Message/Command/EGateCommand";
import { RolePlayer } from "../scene/player/entity/RolePlayer";
import { PlayerEvent } from "../scene/events/PlayerEvent";
import { EPublicCommand } from "../../../Message/Command/EPublicCommand";
import { ItemData } from "../resource/info/ItemData";
import { GameProxy } from "../mvc/GameProxy";
import { DataEvent } from "../events/DataEvent";
import { SecTimer } from "../../../com/gengine/core/frame/SecTimer";
import { TimerType } from "../../../com/gengine/core/frame/TimerType";
import { Cache } from "../cache/Cache";
import { WardrobeConfig } from "../resource/WardrobeConfig";
import { MsgManager } from "../manager/MsgManager";
import { Language } from "../../../extend/language/Language";
import { SelectNumWindow } from "../view/common/SelectNumWindow";
import { Global } from "../../../com/gengine/global/Global";
import { SystemSetter } from "../view/system/SystemSetter";
import { Alert } from "../../../com/mui/controls/Alert";
import { StrengthAddConfig } from "../resource/StrengthAddConfig";
import { SFlyExpAndGrowInfo } from "../../../Message/Public/SFlyExpAndGrowInfo";
import { SPlayerFashionSuitCollections } from "../../../Message/Game/SPlayerFashionSuitCollections";
import { SAttribute } from "../../../Message/Public/SAttribute";
import { LadderBattlefieldUtil } from "../view/ladderBattlefield/LadderBattlefieldUtil";
import { EPlayerItemPosType } from "../../../Message/Public/EPlayerItemPosType";
import { WardrobeType } from "../view/wardrobe/WardrobeType";
type int = number;
//class FashionBoxController
    
    export  class FashionBoxController extends Controller
    {
       

        /* internal  */onWeaponFashionCollectionHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerWingCollection;
            cache.wardrobe.weaponFashionCollectDic = loc1.collectons;
            cache.wardrobe.setLastChangeDt(loc1.lastChangeDt, EMergeType._EMergeTypeWeaponFashion);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateMergeLevel();
            }
            return;
        }

        public get fashionBoxModule(): IFashionBoxModule
        {
            if (null == this._fashionBoxModule) 
            {
                this.initView();
            }
            return this._fashionBoxModule;
        }

        public /* override */ get view(): IView
        {
            return this.initView();
        }

        protected /* override */ initView(): IView
        {
            if (null == this._fashionBoxModule) 
            {
                this._fashionBoxModule = new FashionBoxModule();
            }
            return this._fashionBoxModule;
        }

        /* internal  */onFootprintCollectionHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerWingCollection;
            cache.wardrobe.footPrintCollectDic = loc1.collectons;
            cache.wardrobe.setLastChangeDt(loc1.lastChangeDt, EMergeType._EMergeTypeFootprint);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateMergeLevel();
            }
            return;
        }

        public get flyWingFeedPanel(): FashionBoxFlyWingFeedPanel
        {
            if (!this._flyWingFeedPanel) 
            {
                this._flyWingFeedPanel = new FashionBoxFlyWingFeedPanel();
            }
            return this._flyWingFeedPanel;
        }

        protected /* override */ initServer(): void
        {
            super.initServer();
            Dispatcher.addEventListener(EventName.FashionBoxModuleShow, this.onFashionBoxModuleShowHandler);
            Dispatcher.addEventListener(EventName.MoveToWardrobe, this.onMoveToWardrobeHandler);
            Dispatcher.addEventListener(EventName.WardrobeChangeWingSuccess, this.onChangeWingSuccessHandler);
            Dispatcher.addEventListener(EventName.WardrobeRemove, this.onWardrobeRemoveHandler);
            Dispatcher.addEventListener(EventName.WardrobeChangeWingModel, this.onWardrobeChangeWingModelHandler);
            Dispatcher.addEventListener(EventName.WardrobeRemoveSuccess, this.onWardrobeRemoveSuccessHandler);
            Dispatcher.addEventListener(EventName.WingMergeSuccess, this.onWingMergeSuccessHandler);
            Dispatcher.addEventListener(EventName.WardrobeMoveOutOfWardrobe, this.onWardrobeMoveOutOfHandler);
            Dispatcher.addEventListener(EventName.WardrobeChangeWingShape, this.onWardrobeChangeWingShapeHandler);
            Dispatcher.addEventListener(EventName.WardrobeChangeWingShapeSuccess, this.onChangeWingShapeSuccessHandler);
            Dispatcher.addEventListener(EventName.WardrobeGuideOpen, this.onWardrobeGuideOpenHandler);
            Dispatcher.addEventListener(EventName.FashionBoxSuitGoChangeModel, this.onFashionBoxSuitGoChangeModelHandler);
            NetDispatcher.addCmdListener(ServerCommand.BackPackWardrobeItemsChange, this.onBackPackWardrobeItemsHandler);
            NetDispatcher.addCmdListener(ServerCommand.BackPackItemsChange, this.onBackPackChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.BackpackDataChange, this.onBackPackChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.StonepackDataChange, this.onStonepackDataChange);
            NetDispatcher.addCmdListener(ServerCommand.StonepackItemsChange, this.onStonepackDataChange);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateWingCollection, this.onWingCollectionHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateFashionCollection, this.onFashionCollectionHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateWeaponFashionCollection, this.onWeaponFashionCollectionHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateFootprintCollection, this.onFootprintCollectionHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateBubbleCollection, this.onBubbleCollectionHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateSurroundCollection, this.onSurroundCollectionHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateWaistBeltCollection, this.onWaistBeltCollectionHandler);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateElfCollection, this.onELFCollectionHandler);
            NetDispatcher.addCmdListener(ServerCommand.RolepackDataChange, this.onRolepackDataChangeHandler);
            NetDispatcher.addCmdListener(ServerCommand.RolePackItemsChange, this.onRolepackDataChangeHandler);
            Dispatcher.addEventListener(EventName.WingGoMerge, this.onWingGoMerge);
            RolePlayer.instance.addEventListener(PlayerEvent.UpdateEquip, this.onUpdateEquipHandler);
            Dispatcher.addEventListener(EventName.SexAttributeSexChange, this.onSexChangeModel);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateModelChange, this.onModleChangeTime);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateFashionSuitCollection, this.onFashionSuitCollection);
            Dispatcher.addEventListener(EventName.FashionJewelInfoUpdate, this.onFashionJewelInfoUpdate);
            Dispatcher.addEventListener(EventName.FashionJewelGoFeed, this.onFashionJewelGoFeed);
            Dispatcher.addEventListener(EventName.FashionJewelGoUpgrade, this.onFashionJewelGoUpgrade);
            Dispatcher.addEventListener(EventName.FashionJewelCostExpUpdage, this.onFashionJewelCostExpUpdage);
            Dispatcher.addEventListener(EventName.FashionJewelFeedSuccess, this.onFashionJewelFeedSuccess);
            Dispatcher.addEventListener(EventName.AutoGuideStepEnd, this.stepEndHandler);
            RolePlayer.instance.addEventListener(PlayerEvent.RoleLevelUpdate, this.onRoleLevelUpdateHandler);
            NetDispatcher.addCmdListener(EPublicCommand._ECmdPublicFashionJewelGuide, this.onFashionJewelGuide);
            Dispatcher.addEventListener(EventName.FashionJewelTidyPack, this.onFashionJewelTidyPack);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateFlyExpAndGrowInfo, this.onECmdGateFlyExpAndGrowInfo);
            Dispatcher.addEventListener(EventName.FashionFlyWingUpgradeLvViewOpen, this.onFashionFlyWingUpgradeLvViewOpen);
            Dispatcher.addEventListener(EventName.FashionFlyWingGoUpgradeLv, this.onFashionFlyWingGoUpgradeLv);
            Dispatcher.addEventListener(EventName.FashionFlyWingGoUpgradeLvSuccess, this.onFashionFlyWingGoUpgradeLvSuccess);
            Dispatcher.addEventListener(EventName.FashionFlyWingGoGrow, this.onFashionFlyWingGoGrow);
            Dispatcher.addEventListener(EventName.FashionFlyWingGoGrowSuccess, this.onFashionFlyWingGoGrowSuccess);
            Dispatcher.addEventListener(EventName.FashionFlyWingControlGrowBtn, this.onFashionFlyWingControlGrowBtn);
            Dispatcher.addEventListener(EventName.FashionFlyWingTigerStop, this.onFashionFlyWingTigerStop);
            Dispatcher.addEventListener(EventName.FashionFlyLvAddExp, this.onFashionFlyLvAddExp);
            Dispatcher.addEventListener(EventName.FashionFlyWingGoUpgradeLvBulk, this.onFashionFlyWingGoUpgradeLvBulk);
            NetDispatcher.addCmdListener(ServerCommand.RoleCareerSecondUpdate, this.onRoleCareerChange);
            NetDispatcher.addCmdListener(ServerCommand.RoleCareerEnableUpdate, this.onRoleCareerChange);
            Dispatcher.addEventListener(EventName.FashionBoxModuleShowToTab, this.onFashionBoxModuleShowToTab);
            return;
        }

        /* internal  */onSelectNumOkHandler(arg1: ItemData, arg2: int): void
        {
            var loc1=new Map<any, any> /* flash.utils.Dictionary */();
            loc1[arg1.uid] = arg2;
            GameProxy.fashionBox.upgradeFlyExp(loc1);
            return;
        }

        /* internal  */onRolepackDataChangeHandler(arg1: Object): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.dressUpdateWardrobe();
                this._fashionBoxModule.mergeUpdateData();
            }
            return;
        }

        /* internal  */onFashionJewelTidyPack(arg1: DataEvent): void
        {
            if (!this._timer) 
            {
                this._timer = new SecTimer(1, 10);
                this._timer.addListener(TimerType.COMPLETE, this.complete_Handler);
            }
            if (!this._timer.running) 
            {
                this._timer.start();
                this._triggerTime = flash.utils.getTimer();
                GameProxy.packProxy.tidy(false);
            }
            return;
        }

        /* internal  */complete_Handler(arg1: SecTimer): void
        {
            var loc1=flash.utils.getTimer();
            var loc2=10 * 1000 + this._triggerTime - loc1;
            if (loc2 <= 0) 
            {
                this.clearCountDown();
            }
            else 
            {
                flash.utils.setTimeout(this.clearCountDown, loc2);
            }
            return;
        }

        public clearCountDown(): void
        {
            if (this._timer) 
            {
                this._timer.stop();
                this._timer.dispose();
                this._timer = null;
            }
            return;
        }

        /* internal  */onFashionBoxModuleShowToTab(arg1: DataEvent): void
        {
            if (this.fashionBoxModule.isHide) 
            {
                this.fashionBoxModule.showToTab(int(arg1.data));
                this.fashionBoxModule.show();
            }
            else 
            {
                this.fashionBoxModule.showToTab(int(arg1.data));
            }
            return;
        }

        /* internal  */onWingGoMerge(arg1: DataEvent): void
        {
            var loc1=arg1.data as Object;
            GameProxy.equipmentProxy.wingMerge(loc1.wingUid1, loc1.wingUid2, loc1.posType1, loc1.posType2, loc1.mergeType);
            return;
        }

        /* internal  */onFashionFlyWingGoUpgradeLvBulk(arg1: DataEvent): void
        {
            var loc2=null;
            if (Cache.instance.wardrobe.flyWingInfo.flyLevel >= WardrobeConfig.instance.getMaxFlyLv()) 
            {
                MsgManager.showRollTipsMsg(Language.getString(60374));
                return;
            }
            var loc1=arg1.data as ItemData;
            if (this._selectNumWindow == null) 
            {
                this._selectNumWindow = new SelectNumWindow();
            }
            this._selectNumWindow.updateByItemData(loc1, this.onSelectNumOkHandler);
            this._selectNumWindow.show();
            loc2 = new Object /* flash.geom.Point */(Global.stage.mouseX, Global.stage.mouseY);
            this._selectNumWindow.x = loc2.x - this._selectNumWindow.btnOK.x;
            this._selectNumWindow.y = loc2.y - this._selectNumWindow.btnOK.y;
            return;
        }

        /* internal  */onUpdateEquipHandler(arg1: Object): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.changeWingShape();
            }
            return;
        }

        /* internal  */onFashionFlyLvAddExp(arg1: DataEvent): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateFlyWingLv(arg1.data as int);
            }
            return;
        }

        protected onRoleLevelUpdateHandler(arg1: Object /* flash.events.Event */): void
        {
            var event: Object /* flash.events.Event */;
            var onClickHandler: Function;

            var loc1;
            onClickHandler = null;
            event = arg1;
            onClickHandler = (arg1: int): void
            {
                fashionBoxModule.showToTab(3);
                fashionBoxModule.show();
                return;
            }
            if (cache.clientSettingCache.isFashionBoxFlyWingGuild && cache.role.entityInfo.level >= 90) 
            {
                cache.clientSettingCache.isFashionBoxFlyWingGuild = false;
                SystemSetter.systemGuideSetterInfo.setSystemInfo("isFashionBoxFlyWingGuild", false);
                Dispatcher.dispatchEvent(new DataEvent(EventName.SaveGuideSystemSetter));
                Alert.show(Language.getString(74662), null, Alert.OK, null, onClickHandler);
            }
            return;
        }

        /* internal  */onFashionBoxSuitGoChangeModelHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            GameProxy.roleProxy.useFashionSuitModel(loc1);
            return;
        }

        /* internal  */onFashionFlyWingTigerStop(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            if (loc1 != 1) 
            {
                this._tigerCount == 0;
            }
            else 
            {
                var loc2;
                var loc3=((loc2 = this)._tigerCount + 1);
                loc2._tigerCount = loc3;
                if (this._tigerCount >= 4) 
                {
                    this._tigerCount = 0;
                    if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
                    {
                        this._fashionBoxModule.controlGrowBtnClikable(true);
                        this._fashionBoxModule.shineResult(true);
                        this._fashionBoxModule.updateFlyWingInfo();
                    }
                }
            }
            return;
        }

        /* internal  */onFashionFlyWingControlGrowBtn(arg1: DataEvent): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.controlGrowBtnClikable(arg1.data as Boolean);
            }
            return;
        }

        /* internal  */onFashionFlyWingGoGrowSuccess(arg1: DataEvent): void
        {
            this.getFlyWingTargetLv(cache.wardrobe.flyWingInfo.growLevelMap);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
                {
                    this._fashionBoxModule.startTiger();
                }
            }
            return;
        }

        /* internal  */onFashionFlyWingGoGrow(arg1: DataEvent): void
        {
            var loc1=arg1.data["batch"];
            var loc2=arg1.data["autoBuy"];
            var loc3=arg1.data["uids"];
            GameProxy.fashionBox.cultureFlyGrow(loc1, loc2, loc3);
            return;
        }

        /* internal  */onFashionFlyWingGoUpgradeLvSuccess(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            this.getFlyWingTargetLv(cache.wardrobe.flyWingInfo.growLevelMap);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateFlyWingLv(loc1);
                this._fashionBoxModule.updateFlyWingInfo();
            }
            return;
        }

        /* internal  */onFashionFlyWingGoUpgradeLv(arg1: DataEvent): void
        {
            if (Cache.instance.wardrobe.flyWingInfo.flyLevel >= WardrobeConfig.instance.getMaxFlyLv()) 
            {
                MsgManager.showRollTipsMsg(Language.getString(60374));
                return;
            }
            var loc1=arg1.data as Map<any, any> /* flash.utils.Dictionary */;
            GameProxy.fashionBox.upgradeFlyExp(loc1);
            return;
        }

        /* internal  */getFlyWingTargetLv(arg1: Map<any, any> /* flash.utils.Dictionary */): void
        {
            var loc3=0;
            var loc4=0;
            var loc5=0;
            var loc6=0;
            var loc7=0;
            var loc8=0;
            var loc9=0;
            var loc10=0;
            var loc1=StrengthAddConfig.instance.fashionFlyWingTargetArr.length;
            var loc2=[];
            var loc11=0;
            var loc12=arg1;
            for(loc3 of loc12) 
            {
                loc2.push(loc3);
            }
            loc4 = loc2.length;
            loc8 = 0;
            loc9 = 0;
            while (loc9 < loc1) 
            {
                loc6 = StrengthAddConfig.instance.fashionFlyWingTargetArr[loc9];
                loc8 = 0;
                loc10 = 0;
                while (loc10 < loc4) 
                {
                    if ((loc7 = loc2[loc10]) >= loc6) 
                    {
                        ++loc8;
                    }
                    ++loc10;
                }
                if (loc8 != loc4) 
                {
                    if (loc9 == 0) 
                    {
                        loc5 = 0;
                    }
                    break;
                }
                else 
                {
                    loc5 = loc6;
                }
                ++loc9;
            }
            cache.wardrobe.flyWingTargetLv = loc5;
            return;
        }

        /* internal  */onECmdGateFlyExpAndGrowInfo(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SFlyExpAndGrowInfo;
            cache.wardrobe.flyWingInfo = loc1;
            this.getFlyWingTargetLv(cache.wardrobe.flyWingInfo.growLevelMap);
            return;
        }

        /* internal  */onFashionFlyWingUpgradeLvViewOpen(arg1: DataEvent): void
        {
            if (this.flyWingFeedPanel.isHide) 
            {
                this.flyWingFeedPanel.updatePropsList();
                this.flyWingFeedPanel.show();
            }
            else 
            {
                this.flyWingFeedPanel.hide();
            }
            return;
        }

        /* internal  */onStonepackDataChange(arg1: Object): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateJewel();
            }
            return;
        }

        /* internal  */onFashionJewelGuide(arg1: MessageBlock): void
        {
            cache.wardrobe.fashionJewelGuideUsed = false;
            this.fashionJewelGuideStart();
            return;
        }

        protected fashionJewelGuideStart(): void
        {
            var loc2=null;
            var loc1=cache.role.entityInfo.level;
            if (loc1 >= 90 && !cache.wardrobe.fashionJewelGuideUsed) 
            {
                loc2 = {};
                loc2["mainId"] = 8;
                loc2["stepId"] = 1;
                Dispatcher.dispatchEvent(new DataEvent(EventName.AutoGuideActiveByEvent, loc2));
            }
            return;
        }

        /* internal  */stepEndHandler(arg1: DataEvent): void
        {
            return;
        }

        /* internal  */onFashionJewelFeedSuccess(arg1: DataEvent): void
        {
            MsgManager.showRollTipsMsg(Language.getString(74605));
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.cleanCostItem();
            }
            return;
        }

        /* internal  */onFashionJewelCostExpUpdage(arg1: DataEvent): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateCostExp();
            }
            return;
        }

        /* internal  */onFashionJewelGoUpgrade(arg1: DataEvent): void
        {
            var loc1=arg1.data["fashionType"];
            var loc2=arg1.data["jewelType"];
            GameProxy.fashionBox.upgradeFashionJewel(loc1, loc2);
            return;
        }

        /* internal  */onFashionJewelGoFeed(arg1: DataEvent): void
        {
            var loc1=arg1.data["dic"];
            var loc2=arg1.data["jewelType"];
            GameProxy.fashionBox.swallowFashionJewel(loc2, loc1);
            return;
        }

        /* internal  */onFashionJewelInfoUpdate(arg1: DataEvent): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateJewel();
            }
            return;
        }

        /* internal  */onBubbleCollectionHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerWingCollection;
            cache.wardrobe.posBubbleCollectDic = loc1.collectons;
            cache.wardrobe.setLastChangeDt(loc1.lastChangeDt, EMergeType._EMergeTypeBubble);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateMergeLevel();
            }
            return;
        }

        /* internal  */onSurroundCollectionHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerWingCollection;
            cache.wardrobe.surroungdCollectDic = loc1.collectons;
            cache.wardrobe.setLastChangeDt(loc1.lastChangeDt, EMergeType._EMergeTypeSurround);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateMergeLevel();
            }
            return;
        }

        /* internal  */onWaistBeltCollectionHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerWingCollection;
            cache.wardrobe.waistBeltCollectDic = loc1.collectons;
            cache.wardrobe.setLastChangeDt(loc1.lastChangeDt, EMergeType._EMergeTypeWaistBelt);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateMergeLevel();
            }
            return;
        }

        /* internal  */onELFCollectionHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerWingCollection;
            cache.wardrobe.elfCollectDic = loc1.collectons;
            cache.wardrobe.setLastChangeDt(loc1.lastChangeDt, EMergeType._EMergeTypeElf);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateMergeLevel();
            }
            return;
        }

        /* internal  */onRoleCareerChange(arg1: Object): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateCarrer();
            }
            return;
        }

        /* internal  */onSexChangeModel(arg1: DataEvent): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updatePlayerSex();
            }
            return;
        }

        /* internal  */onFashionSuitCollection(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerFashionSuitCollections;
            cache.wardrobe.wearedCollectArr = loc1.itemCodes;
            this.onBackPackChangeHandler(null);
            return;
        }

        /* internal  */onBackPackWardrobeItemsHandler(arg1: Object=null): void
        {
            this.onBackPackChangeHandler(null);
            if (!(cache.wardrobe.undressItemUid == "") && this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.setUndressItem();
            }
            return;
        }

        /* internal  */onModleChangeTime(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SAttribute;
            cache.wardrobe.changeModelTime = loc1.value;
            cache.wardrobe.changeModelLastTime = loc1.valueStr;
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateChangeModelTime();
            }
            return;
        }

        /* internal  */onFashionBoxModuleShowHandler(arg1: DataEvent): void
        {
            if (LadderBattlefieldUtil.isInLadderBattlefield) 
            {
                MsgManager.showRollTipsMsg(Language.getString(28836));
                return;
            }
            if (this.view.isHide) 
            {
                this.view.show();
            }
            else 
            {
                this.view.hide();
            }
            return;
        }

        /* internal  */onMoveToWardrobeHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as ItemData;
            GameProxy.packProxy.moveIntoWardrobe(EPlayerItemPosType._EPlayerItemPosTypeBag, loc1.uid);
            return;
        }

        /* internal  */onChangeWingSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.lastChangeDt as Date;
            var loc3=loc1.retMergeType as int;
            cache.wardrobe.setLastChangeDt(loc2, loc3);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.dressUpdateWardrobe();
            }
            return;
        }

        /* internal  */onWardrobeRemoveHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as string;
            GameProxy.packProxy.removeItemInWardrobe(loc1);
            return;
        }

        /* internal  */onWardrobeChangeWingModelHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.code as int;
            var loc3=loc1.type as int;
            var loc4=0;
            if (loc3 != WardrobeType.WardrobeWing) 
            {
                if (loc3 != WardrobeType.WardrobeFashion) 
                {
                    if (loc3 != WardrobeType.WardrobeFashionWeapon) 
                    {
                        if (loc3 != WardrobeType.WardrobeFootPrint) 
                        {
                            if (loc3 != WardrobeType.WardrobeBubble) 
                            {
                                if (loc3 != WardrobeType.WardrobeSurroung) 
                                {
                                    if (loc3 != WardrobeType.WardrobeWaistBelt) 
                                    {
                                        if (loc3 == WardrobeType.WardrobeElf) 
                                        {
                                            loc4 = EMergeType._EMergeTypeElf;
                                        }
                                    }
                                    else 
                                    {
                                        loc4 = EMergeType._EMergeTypeWaistBelt;
                                    }
                                }
                                else 
                                {
                                    loc4 = EMergeType._EMergeTypeSurround;
                                }
                            }
                            else 
                            {
                                loc4 = EMergeType._EMergeTypeBubble;
                            }
                        }
                        else 
                        {
                            loc4 = EMergeType._EMergeTypeFootprint;
                        }
                    }
                    else 
                    {
                        loc4 = EMergeType._EMergeTypeWeaponFashion;
                    }
                }
                else 
                {
                    loc4 = EMergeType._EMergeTypeFashion;
                }
            }
            else 
            {
                loc4 = EMergeType._EMergeTypeWing;
            }
            GameProxy.roleProxy.changeWingModel(loc2, loc4);
            return;
        }

        /* internal  */onWardrobeRemoveSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as string;
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateWardrobe();
            }
            return;
        }

        /* internal  */onWingMergeSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data;
            var loc2=loc1.result;
            var loc3=loc1.resultPlayerItem;
            var loc4=loc1.retMergeType;
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateWardrobe();
                this._fashionBoxModule.mergeSuccessUpdate(loc4);
            }
            return;
        }

        /* internal  */onWardrobeMoveOutOfHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as ItemData;
            GameProxy.packProxy.moveOutOfWardrobe(EPlayerItemPosType._EPlayerItemPosTypeBag, loc1.uid);
            return;
        }

        /* internal  */onWardrobeChangeWingShapeHandler(arg1: DataEvent): void
        {
            GameProxy.roleProxy.changeWingShape();
            return;
        }

        /* internal  */onChangeWingShapeSuccessHandler(arg1: DataEvent): void
        {
            return;
        }

        /* internal  */onWardrobeGuideOpenHandler(arg1: DataEvent): void
        {
            this.view.show();
            return;
        }

        /* internal  */onBackPackChangeHandler(arg1: Object=null): void
        {
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateBackPack();
            }
            if (this._flyWingFeedPanel && !this._flyWingFeedPanel.isHide) 
            {
                this._flyWingFeedPanel.updatePropsList();
            }
            return;
        }

        /* internal  */onWingCollectionHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerWingCollection;
            cache.wardrobe.wingCollectDic = loc1.collectons;
            cache.wardrobe.setLastChangeDt(loc1.lastChangeDt, EMergeType._EMergeTypeWing);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateMergeLevel();
            }
            return;
        }

        /* internal  */onFashionCollectionHandler(arg1: MessageBlock): void
        {
            var loc1=arg1.messageBase as SPlayerWingCollection;
            cache.wardrobe.fashionCollectDic = loc1.collectons;
            cache.wardrobe.setLastChangeDt(loc1.lastChangeDt, EMergeType._EMergeTypeFashion);
            if (this._fashionBoxModule && !this._fashionBoxModule.isHide) 
            {
                this._fashionBoxModule.updateMergeLevel();
            }
            return;
        }

        private /* var */_fashionBoxModule: IFashionBoxModule;

        private /* var */_flyWingFeedPanel: FashionBoxFlyWingFeedPanel;

        private /* var */_triggerTime: int;

        private /* var */_selectNumWindow: SelectNumWindow;

        private /* var */_timer: SecTimer;

        private /* var */_tigerCount: int=0;
    }
